<?php
if (!defined("IN_OP"))
{
    exit("You can't access this file directly...");
}
if (!isset($_SESSION['subaccount']))
{
    exit();
}
$gametype = intval(getvar("gametype"));
$gType = chkGametype($gametype);
switch ($gType)
{
    case 0 :
        $ui = new UI();
        break;
    default :
        include_once( "class_3d/CheckMode_3d.php" );
        $chk = new CheckMode_3d($curruser['acl'], 1, $gametype);
        $chk->checkShow3dPage();
        unset($chk);
        $ui = new UI_3D();
        $jslink = "<script language=\"JScript.Encode\" src=\"site.js\"></script>" . ( "<script language=\"VBScript.Encode\" src=\"site.vbs\"></script>" );
        $ui->set("jslink", $jslink);
        $ui->header();
        break;
}
$tpl = new Template2();
$conf = new Config();
$sub_id = $_SESSION['subaccount'];
$chgPassWD = getvar("chgpasswd");
if ($chgPassWD != "")
{
    getdb("update k_user set pass='" . md5($chgPassWD) . "' where id={$sub_id}");
    $tpl->set("msg", L_CHGPWDSUCC);
}
$tpl->load(array("main" => "subinfo.htm"));
$rs = getdb("select account,name,amount,amount_3d, amount_3s1 from k_user where id={$sub_id}");
$tpl->set(array("account" => $rs->f['account'], "name" => $rs->f['name'], "gametype" => $gametype));
if ($g_init_mode_6h)
{
    $amountStr6H = "<tr align=right><td class=\"td0 bgClc_{$gametype}\">【六合彩】信用额度</td><td class=td2>" . $rs->f['amount'] . "</td></tr>";
    $tpl->set("amountStr6H", $amountStr6H);
}
if ($g_init_mode_3d)
{
    $amountStr3D = "<tr align=right><td class=\"td0 bgClc_{$gametype}\">【福体彩】信用额度</td><td class=td2>" . $rs->f['amount_3d'] . "</td></tr>" . "<tr align=right><td class=\"td0 bgClc_{$gametype}\">【时时彩】信用额度</td><td class=td2>" . $rs->f['amount_3s1'] . "</td></tr>";
    $tpl->set("amountStr3D", $amountStr3D);
}
echo title("设置 - 修改子帐号密码");
$tpl->show("main");
$ui->footer();
?>